<template>
  <el-dialog
    :visible.sync="visible"
    width="400px"
    :modal="false"
    :show-close="false"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    center
  >
    <div
      v-loading="true"
      :element-loading-text="loadingText"
      element-loading-spinner="el-icon-loading"
    >
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: 'LoadingDialog',
  data() {
    return {
      visible: this.value
    }
  },
  watch: {
    visible() {
      this.$emit('input', this.visible)
    },
    value() {
      this.visible = this.value
    }
  },
  props: {
    value: {
      type: Boolean,
      default: false
    },
    loadingText: {
      type: String,
      default: '处理中，请稍等'
    }
  }
}
</script>

<style scoped>

</style>
